package org.kommii.common_utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTime_Utils {
	
	private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	private static SimpleDateFormat simpleDateFormat_date = new SimpleDateFormat("yyyy-MM-dd");
	
	public static String getDateString(long timeMillis){
		Date date = new Date(timeMillis);
		return simpleDateFormat.format(date);
	}
	
	public static String getDateString(Date date){
		return simpleDateFormat.format(date);
	}
	
	public static String getDateString(){
		Date date = new Date();
		return simpleDateFormat.format(date);
	}
	
	
	public static long getCurrentSeconds(){
		long temp = System.currentTimeMillis();
		long now = temp/1000;
		return now;
	}
	
	public static long getCurrentSeconds(long timeMillis){
		long now = timeMillis/1000;
		return now;
	}
	
	public static int getDateInt(){
		Date date = new Date();
		String temp = simpleDateFormat_date.format(date);
		temp = temp.replace("-", "");	
		return  Integer.parseInt(temp);
	}
	
	public static void main(String[] args){ 
		int a = getDateInt();
		System.out.println(a);
		long temp = System.currentTimeMillis();
		long now = temp/1000;
		System.out.println(temp);
		System.out.println(now);
		String s = getDateString();
		System.out.println(s);
	}

}
